home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 10 - 1994 / 10.08 Aug 94 / Getting Started Changes < prev   
Encoding:
Text File  |  1994-07-18  |  9.1 KB  |  389 lines  |  [TEXT/MPS ]

  1. Hello2
  2. 1)    In the routine ToolBoxInit(), change:
  3.         InitGraf( &thePort );
  4.     to
  5.         InitGraf( &qd.thePort );
  6.  
  7. 2)    In the routine ToolBoxInit(), change:
  8.         InitDialogs( nil );
  9.     to
  10.         InitDialogs( 0L );
  11.  
  12.  
  13. Mondrian
  14. 1)    In the routine ToolBoxInit(), change:
  15.         InitGraf( &thePort );
  16.     to
  17.         InitGraf( &qd.thePort );
  18.  
  19. 2)    In the routine ToolBoxInit(), change:
  20.         InitDialogs( nil );
  21.     to
  22.         InitDialogs( 0L );
  23.  
  24. 3)    In the routine MainLoop(), change:
  25.         GetDateTime( (unsigned long *)(&randSeed) );
  26.     to
  27.         GetDateTime( (unsigned long *)(&qd.randSeed) );
  28.  
  29.  
  30. ShowPICT
  31. 1)    In the routine ToolBoxInit(), change:
  32.         InitGraf( &thePort );
  33.     to
  34.         InitGraf( &qd.thePort );
  35.  
  36. 2)    In the routine ToolBoxInit(), change:
  37.         InitDialogs( nil );
  38.     to
  39.         InitDialogs( 0L );
  40.  
  41.  
  42. FlyingLine
  43. 1)    In the routine ToolBoxInit(), change:
  44.         InitGraf( &thePort );
  45.     to
  46.         InitGraf( &qd.thePort );
  47.  
  48. 2)    In the routine ToolBoxInit(), change:
  49.         InitDialogs( NULL );
  50.     to
  51.         InitDialogs( 0L );
  52.  
  53. 3)    In the routine WindowInit(), get rid of the unused local variable totalRect.
  54.  
  55. 4)    In the routine WindowInit(), change:
  56.         gOldMBarHeight = MBarHeight;
  57.         MBarHeight = 0;
  58.     to
  59.         gOldMBarHeight = LMGetMBarHeight();
  60.         LMSetMBarHeight( 0 );
  61.  
  62. 5)    In the routine WindowInit(), change:
  63.         window = NewWindow( nil, &(screenBits.bounds),
  64.             kEmptyTitle, kVisible, plainDBox, kMoveToFront,
  65.             kNoGoAway, kNilRefCon );
  66.     to
  67.         window = NewWindow( nil, &(qd.screenBits.bounds),
  68.             kEmptyTitle, kVisible, plainDBox, kMoveToFront,
  69.             kNoGoAway, kNilRefCon );
  70.  
  71. 6)    In the routine WindowInit(), change:
  72.         SetRect( &mBarRect, screenBits.bounds.left,
  73.             screenBits.bounds.top,
  74.             screenBits.bounds.right,
  75.             screenBits.bounds.top+gOldMBarHeight );
  76.     to
  77.         SetRect( &mBarRect, qd.screenBits.bounds.left,
  78.             qd.screenBits.bounds.top,
  79.             qd.screenBits.bounds.right,
  80.             qd.screenBits.bounds.top+gOldMBarHeight );
  81.  
  82. 7)    In the routine WindowInit(), change:
  83.         FillRect( &(window->portRect), black );
  84.     to
  85.         FillRect( &(window->portRect), &qd.black );
  86.  
  87. 8)    In the routine LinesInit(), change:
  88.         GetDateTime( (unsigned long *)(&randSeed) );
  89.     to
  90.         GetDateTime( (unsigned long *)(&qd.randSeed) );
  91.  
  92. 9)    In the routine MainLoop(), change:
  93.         MBarHeight = gOldMBarHeight;
  94.     to
  95.         LMSetMBarHeight( gOldMBarHeight );
  96.  
  97.  
  98. EventTracker
  99. 1)    In the routine ToolBoxInit(), change:
  100.         InitGraf( &thePort );
  101.     to
  102.         InitGraf( &qd.thePort );
  103.  
  104. 2)    In the routine ToolBoxInit(), change:
  105.         InitDialogs( nil );
  106.     to
  107.         InitDialogs( 0L );
  108.  
  109. 3)    Change the #include:
  110.         #include <Values.h>
  111.     to
  112.         #include <limits.h>
  113.  
  114. 4)    Change the #define:
  115.         #define kSleep                MAXLONG
  116.     to
  117.         #define kSleep                LONG_MAX
  118.  
  119. 5)    Near the top of the file, just after the declaration of gDone, add the global declaration:
  120.     AEEventHandlerUPP    gDoOpenAppUPP,
  121.                             gDoOpenDocUPP,
  122.                             gDoPrintDocUPP,
  123.                             gDoQuitAppUPP;
  124.  
  125. 6) In the routine WindowInit(), delete the unused local variable windRect.
  126.  
  127. 7)    In the routine EventInit(), change:
  128.         err = AEInstallEventHandler( kCoreEventClass, kAEOpenApplication,
  129.                 DoOpenApp, 0L, false );
  130.     to
  131.         gDoOpenAppUPP = NewAEEventHandlerProc( DoOpenApp );
  132.         err = AEInstallEventHandler( kCoreEventClass, kAEOpenApplication,
  133.                 gDoOpenAppUPP, 0L, false );
  134.  
  135. 8)    In the routine EventInit(), change:
  136.         err = AEInstallEventHandler( kCoreEventClass, kAEOpenDocuments,
  137.                 DoOpenDoc, 0L, false );
  138.     to
  139.         gDoOpenDocUPP = NewAEEventHandlerProc( DoOpenDoc );
  140.         err = AEInstallEventHandler( kCoreEventClass, kAEOpenDocuments,
  141.                 gDoOpenDocUPP, 0L, false );
  142.  
  143. 9)    In the routine EventInit(), change:
  144.         err = AEInstallEventHandler( kCoreEventClass, kAEPrintDocuments,
  145.                 DoPrintDoc, 0L, false );
  146.     to
  147.         gDoPrintDocUPP = NewAEEventHandlerProc( DoPrintDoc );
  148.         err = AEInstallEventHandler( kCoreEventClass, kAEPrintDocuments,
  149.                 gDoPrintDocUPP, 0L, false );
  150.  
  151. 10) In the routine EventInit(), change:
  152.         err = AEInstallEventHandler( kCoreEventClass, kAEQuitApplication,
  153.                 DoQuitApp, 0L, false );
  154.     to
  155.         gDoQuitAppUPP = NewAEEventHandlerProc( DoQuitApp );
  156.         err = AEInstallEventHandler( kCoreEventClass, kAEQuitApplication,
  157.                 gDoQuitAppUPP, 0L, false );
  158.  
  159. 11) In the routine HandleMouseDown(), change:
  160.         DragWindow( window, eventPtr->where, &screenBits.bounds );
  161.     to
  162.         DragWindow( window, eventPtr->where, &qd.screenBits.bounds );
  163.  
  164.  
  165. Updater
  166. 1)    In the routine ToolBoxInit(), change:
  167.         InitGraf( &thePort );
  168.     to
  169.         InitGraf( &qd.thePort );
  170.  
  171. 2)    In the routine ToolBoxInit(), change:
  172.         InitDialogs( nil );
  173.     to
  174.         InitDialogs( 0L );
  175.  
  176. 3)    Change the #include:
  177.         #include <Values.h>
  178.     to
  179.         #include <limits.h>
  180.  
  181. 4)    Change the #define:
  182.         #define kSleep                MAXLONG
  183.     to
  184.         #define kSleep                LONG_MAX
  185.  
  186. 5)    In the routine HandleMouseDown(), change:
  187.         growRect.bottom = MAXSHORT;
  188.         growRect.right = MAXSHORT;
  189.     to
  190.         growRect.bottom = INT_MAX;
  191.         growRect.right = INT_MAX;
  192.  
  193. 6)    In the routine HandleMouseDown(), change:
  194.         DragWindow( window, eventPtr->where, &screenBits.bounds );
  195.     to
  196.         DragWindow( window, eventPtr->where, &qd.screenBits.bounds );
  197.  
  198.  
  199. EventTrigger
  200. 1)    In the routine ToolBoxInit(), change:
  201.         InitGraf( &thePort );
  202.     to
  203.         InitGraf( &qd.thePort );
  204.  
  205. 2)    In the routine ToolBoxInit(), change:
  206.         InitDialogs( nil );
  207.     to
  208.         InitDialogs( 0L );
  209.  
  210.  
  211. WorldClock
  212. 1)    In the routine ToolBoxInit(), change:
  213.         InitGraf( &thePort );
  214.     to
  215.         InitGraf( &qd.thePort );
  216.  
  217. 2)    In the routine ToolBoxInit(), change:
  218.         InitDialogs( nil );
  219.     to
  220.         InitDialogs( 0L );
  221.  
  222. 3)    In the routine HandleMouseDown(), delete the unused local variable oldPort.
  223.  
  224. 4)    In the routine HandleMouseDown(), change:
  225.         DragWindow( window, eventPtr->where, &screenBits.bounds );
  226.     to
  227.         DragWindow( window, eventPtr->where, &qd.screenBits.bounds );
  228.  
  229.  
  230. Reminder
  231. 1)    Delete this struct definition (it’s built-in now):
  232.         struct PopupPrivateData
  233.         {
  234.               MenuHandle  mHandle;
  235.             short       mID;
  236.             char        mPrivate[1];
  237.         };
  238.  
  239. 2)    Delete these function prototypes (they’re built-in now):
  240.         pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, short newItem) 
  241.             = { 0x303C, 0x0304, 0xAA68 };        
  242.         pascal OSErr SetDialogCancelItem(DialogPtr theDialog, short newItem)
  243.               = { 0x303C, 0x0305, 0xAA68 };
  244.         pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks)
  245.             = { 0x303C, 0x0306, 0xAA68 };
  246.  
  247. 3)    In the routine ToolBoxInit(), change:
  248.         InitGraf( &thePort );
  249.     to
  250.         InitGraf( &qd.thePort );
  251.  
  252. 4)    In the routine ToolBoxInit(), change:
  253.         InitDialogs( nil );
  254.     to
  255.         InitDialogs( 0L );
  256.  
  257. 5)    Add this line to the global definitions at the top of the source code:
  258.         NMUPP        gLaunchResponseUPP, gNormalResponseUPP;
  259.  
  260. 6)    In main(), add this code just before the call to EventLoop():
  261.         gLaunchResponseUPP = NewNMProc( LaunchResponse );
  262.         gNormalResponseUPP = NewNMProc( NormalResponse );
  263.  
  264. 7)    In the routine CopyDialogToReminder(), chenge:
  265.         if( reminder->launch = GetCtlValue( (ControlHandle)itemHandle ) )
  266.             reminder->notify.nmResp = (NMProcPtr)&LaunchResponse;
  267.         else
  268.             reminder->notify.nmResp = (NMProcPtr)&NormalResponse;
  269.     to
  270.         if( reminder->launch = GetCtlValue( (ControlHandle)itemHandle ) )
  271.             reminder->notify.nmResp = gLaunchResponseUPP;
  272.         else
  273.             reminder->notify.nmResp = gNormalResponseUPP;
  274.  
  275.  
  276. ResWriter
  277. 1)    Delete these function prototypes (they’re built-in now):
  278.         pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, short newItem) 
  279.             = { 0x303C, 0x0304, 0xAA68 };        
  280.         pascal OSErr SetDialogCancelItem(DialogPtr theDialog, short newItem)
  281.               = { 0x303C, 0x0305, 0xAA68 };
  282.         pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks)
  283.             = { 0x303C, 0x0306, 0xAA68 };
  284.  
  285. 2)    In the routine ToolBoxInit(), change:
  286.         InitGraf( &thePort );
  287.     to
  288.         InitGraf( &qd.thePort );
  289.  
  290. 3)    In the routine ToolBoxInit(), change:
  291.         InitDialogs( nil );
  292.     to
  293.         InitDialogs( 0L );
  294.  
  295.  
  296. Pager
  297. 1)    In the routine ToolBoxInit(), change:
  298.         InitGraf( &thePort );
  299.     to
  300.         InitGraf( &qd.thePort );
  301.  
  302. 2)    In the routine ToolBoxInit(), change:
  303.         InitDialogs( nil );
  304.     to
  305.         InitDialogs( 0L );
  306.  
  307. 3)    Change the #include:
  308.         #include <Values.h>
  309.     to
  310.         #include <limits.h>
  311.  
  312. 4)    Change the #define:
  313.         #define kSleep                MAXLONG
  314.     to
  315.         #define kSleep                LONG_MAX
  316.  
  317. 5)    Near the top of the file, just after the declaration of gDone, add the definition:
  318.         ControlActionUPP    gActionUPP;
  319.  
  320. 6)    In the routine HandleMouseDown(), change:
  321.         else
  322.             thePart = TrackControl( theControl, thePoint, &ScrollProc );
  323.     to
  324.         else
  325.         {
  326.             gActionUPP = NewControlActionProc( ScrollProc );
  327.             thePart = TrackControl( theControl, thePoint, gActionUPP );
  328.         }
  329.  
  330. 7)    In the routine HandleMouseDown(), change:
  331.         DragWindow( window, eventPtr->where, &screenBits.bounds );
  332.     to
  333.         DragWindow( window, eventPtr->where, &qd.screenBits.bounds );
  334.  
  335.  
  336. ShowClip
  337. 1)    In the routine ToolBoxInit(), change:
  338.         InitGraf( &thePort );
  339.     to
  340.         InitGraf( &qd.thePort );
  341.  
  342. 2)    In the routine ToolBoxInit(), change:
  343.         InitDialogs( nil );
  344.     to
  345.         InitDialogs( 0L );
  346.  
  347.  
  348. SoundMaker
  349. 1)    In the routine ToolBoxInit(), change:
  350.         InitGraf( &thePort );
  351.     to
  352.         InitGraf( &qd.thePort );
  353.  
  354. 2)    In the routine ToolBoxInit(), change:
  355.         InitDialogs( nil );
  356.     to
  357.         InitDialogs( 0L );
  358.  
  359.  
  360. OpenPICT
  361. 1)    In the routine ToolBoxInit(), change:
  362.         InitGraf( &thePort );
  363.     to
  364.         InitGraf( &qd.thePort );
  365.  
  366. 2)    In the routine ToolBoxInit(), change:
  367.         InitDialogs( nil );
  368.     to
  369.         InitDialogs( 0L );
  370.  
  371.  
  372. PrintPICT
  373. 1)    Change the #include:
  374.         #include <PrintTraps.h>
  375.     to
  376.         #include <Printing.h>
  377.  
  378. 2)    In the routine ToolBoxInit(), change:
  379.         InitGraf( &thePort );
  380.     to
  381.         InitGraf( &qd.thePort );
  382.  
  383. 3)    In the routine ToolBoxInit(), change:
  384.         InitDialogs( nil );
  385.     to
  386.         InitDialogs( 0L );
  387.  
  388.  
  389.